package com.wkbb.sports.dto;

import java.text.NumberFormat;

public class ProjectRadarDto {
	
	private String name;
	
	private double total;
	
	private double totalScore;
	
	public ProjectRadarDto(String name){
		this.name = name;
	}

	public void add(double total, double totalScore) {
		this.total += total;
		this.totalScore += totalScore;
	}
	
	public String getName() {
		return this.name;
	}

	public String getValue() {
		double value = 0;
		if(total != 0) {
			value = (totalScore / total) / 10;
		}
		NumberFormat nf = NumberFormat.getNumberInstance();
		nf.setMaximumFractionDigits(1);
		return nf.format(value);
	}
}
